package com.base.vistter.iframe.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "sys_role")
public class SysRole extends BaseEntity {

    @ExcelProperty("角色名称")
    @ColumnWidth(50)
    private String name;

    @ExcelProperty("角色描述")
    @ColumnWidth(70)
    private String des;

    @ExcelProperty("排序号")
    @NumberFormat("#")
    @ColumnWidth(20)
    private Integer sort;

    @ExcelIgnore
    @TableField(exist = false)
    private List<Integer> menuIds;

    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer isAdmin;

}
